#!/usr/bin/node 

//用异步方式打印文件内容
const fs = require('fs'),
      log = console.log;
//没有命令参数，默认打印脚本文件内容
const filename = process.argv[2] || __filename;

fs.readFile(filename, (err, data) => {
  if(err) {
    console.error(err.message);
    process.exit(1);
  } else {
    log('后打印：');
    log(data.toString('utf8'));

  }
});
log('先打印01-my-cat-async.js');
//node 01-my-cat-async.js 01-my-cat-async.js
